<%@ page language="java" import="com.anhry.app.safety.util.Util" pageEncoding="UTF-8"%>
<jsp:directive.page import="com.anhry.app.safety.util.Util"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>运城市安全生产隐患排查治理信息系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath+Util.SKIN%>/css/style.css" type="text/css" rel="stylesheet"/>
	<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.2.js"></script>
	<script  type="text/javascript">var _count=true</script>
	<script type="text/javascript" src="<%=basePath%>/js/jquery_timer.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/dbdialog/lhgdialog.js?self=false&<%=Util.DIALOG_SKIN%>"></script>
	
	<script  type="text/javascript">  
	  function switchSysBar(){   
		  if   (switchPoint.value=='1'){ 
			  switchPoint.value='2'
			  tg.src='<%=basePath%>/images/call_right.gif'
			  document.all("frmTitle").style.display="none"   
		  }    else{   
			  switchPoint.value='1'
			  tg.src='<%=basePath%>/images/call_left.gif'
			  document.all("frmTitle").style.display=""   
		  }  
	  }
	  function switchtop(){   
		  if   (switchPoint2.value=='1'){ 
			  switchPoint2.value='2'
			  tg_top.src='<%=basePath%>/images/call_bottom2.gif'
			  document.all("frame_top").style.display="none"   
		  }    else{   
			  switchPoint2.value='1'
			  tg_top.src='<%=basePath%>/images/call_top2.gif'
			  document.all("frame_top").style.display=""   
		  }  
	  }
		$(function(){
		$(".bottom_div").click(function(){
			$("#frame_bottom").toggle();
			$(this).toggleClass("img_down");
		});
	});
	
	function golist(falg){
		if(falg==0){
			window.frames('leftFrame').location.href="<%=basePath%>/admin/index_left.action?funId=5&rightgo=1";
			window.frames('rightFrame').location.href="<%=basePath%>/oa/mail_inMailList.action";
			window.frames('leftFrame').openall();
			
		}
		if(falg==1){
			window.frames('leftFrame').location.href="<%=basePath%>/admin/index_left.action?funId=5&rightgo=1";
			window.frames('rightFrame').location.href="<%=basePath%>/oa/notice_noticeInList.action";
			window.frames('leftFrame').openall();
		}
		if(falg==2){
			window.frames('leftFrame').location.href="<%=basePath%>/admin/index_left.action?funId=184&rightgo=1";
			window.frames('rightFrame').location.href="<%=basePath%>/oa/call_perCallInList.action";
			window.frames('leftFrame').openall();
		}
		if(falg==3){
			window.frames('leftFrame').location.href="<%=basePath%>/admin/index_left.action?funId=5&rightgo=1";
			window.frames('rightFrame').location.href="<%=basePath%>/oa/notice_noticeTopList.action";
			window.frames('leftFrame').openall();
		}
	}
	/*
	function golist2(falg){
		if(falg==0){
			window.frames('rightFrame').location.href="<%=basePath%>/oa/mail_inMailList.action";
		}
		if(falg==1){
			window.frames('rightFrame').location.href="<%=basePath%>/oa/notice_noticeInList.action";
		}
	}
	*/
	</script> 
	<script type="text/javascript">

	//----------------------------------------------
	/* 扩展窗口外部方法 */
		$.dialog.notice = function( options )
		{
		    var opts = options || {},
		        api, aConfig, hide, wrap, top,
		        duration = opts.duration || 800;
		        
		    var config = {
		        left: '100%',
		        top: '100%',
		        //fixed: true,
		        drag: false,
		        resize: false,
		        min: false,
		        max: false,
		        init: function(here){
		            api = this;
		            aConfig = api.config;
		            wrap = api.DOM.wrap;
		            top = parseInt(wrap[0].style.top);
		            hide = top + wrap[0].offsetHeight;
		                        
		            wrap.css('top', hide + 'px')
		            .animate({top: top + 'px'}, duration, function(){
		                opts.init && opts.init.call(api, here);
		            });
		        },
		        close: function(here){
		            wrap.animate({top: hide + 'px'}, duration, function(){
		                opts.close && opts.close.call(this, here);
		                aConfig.close = $.noop;
		                api.close();
		            });
		                        
		            return false;
		        }
		    };
		        
		    for(var i in opts)
		    {
		        if( config[i] === undefined ) config[i] = opts[i];
		    }
		        
		    return $.dialog( config );
		};
	//-----------------
		
		var mail=0;
		var notice=0;
		var call=0;
		var topn=0;
		var falg=false;
		var noticedialog1;
		
		$(this).everyTime('1s','timertemp',getNotReadSize,1);//延时1秒 执行第一次 初始化  防止样式为透明
		$(this).everyTime('15s', getNotReadSize);
		
		function getNotReadSize(){
		
			$.ajax({
				type:"POST",
				async: false,      //ajax同步
				url:"<%=basePath%>/oa/mail_getNotRead.action",
				success:function(data){
					if(mail==data){
						mail=data;
					}else {
						mail=data;
						falg=true;
					}
				}
			});
			$.ajax({
				type:"POST",
				async: false,      //ajax同步
				url:"<%=basePath%>/oa/notice_getNotRead.action",
				success:function(data){
					if(notice==data){
						notice=data;
					}else {
						notice=data;
						falg=true;
					}
				}
			});
			$.ajax({
				type:"POST",
				async: false,      //ajax同步
				url:"<%=basePath%>/oa/notice_getTopNotRead.action",
				success:function(data){
					if(topn==data){
						topn=data;
					}else {
						topn=data;
						falg=true;
					}
				}
			});
			
			$.ajax({
				type:"POST",
				async: false,      //ajax同步
				url:"<%=basePath%>/oa/call_getNotRead.action",
				success:function(data){
					if(call==data){
						call=data;
					}else {
						call=data;
						falg=true;
					}
				}
			});
			//alert('mail='+mail);
			//alert('notice='+notice);
			//alert('falg'+falg);
			
			var content1 ='<font style="font-size: 12">';
			
			if(mail!=0){
				content1+='<a href="javascript:golist(0);">'+mail+'封未读邮件</a><br/>';
			}
			if(notice!=0){
				content1+='<a href="javascript:golist(1);">'+notice+'条未读通知</a><br/>';
			}
			if(call!=0){
				content1+='<a href="javascript:golist(2);">'+call+'条未读提醒</a><br/>';
			}
			if(topn!=0){
				content1+='<a href="javascript:golist(3);">'+topn+'条重要通知!</a><br/>';
			}
			content1+='请您注意查收</font>';
			
			if(falg){
				try{
					if(noticedialog1!=null){
						noticedialog1.close();
					}
				}catch(e){
				
				}
				if(mail!=0||notice!=0||topn!=0){
					ndialog(content1);
				}
				falg=false;
			}
		}
		
		function ndialog(content) {
			noticedialog1=$.dialog.notice({
			    title: '系统提醒',
			    height:80,
			    width: 220,   
			    content:content
			});
		}
		
		
		
	</script>
	<style type="text/css">
		body {
			font-size:12px;
		}
		iframe {
			border:0px;
			margin:0px;
			padding:0px;
		}
		#mainframe {
			width:100%;
			height:100%
		}
	</style>
  </head>
  
	<body>
	
	
		<table border="0" id="mainframe" cellspacing="0" cellpadding="0" width="100%" height="100%" bgcolor="#0176ab">
			<tr id="frame_top">
				<td height="163" colspan=3><iframe name="topFrame" style="VISIBILITY:inherit;position:relative;WIDTH:100%;height:100%;Z-INDEX:2" scrolling="no" frameborder="0" src="<%=basePath%>/admin/index_header.action"></iframe></td>
			</tr>
	  		<tr>
	  			<td class="chink1" height="6"></td>
	  			<td class="chink1" colspan=2 align="center">
	  				<div id="switchPoint2" onClick="switchtop()" title="显示/隐然顶部面板" style="position: inherit;width:100px;z-index:1;" value="1"><img id="tg_top" src="<%=basePath%>/images/call_top2.gif"></div> 
	  			</td>
  			</tr>
			<tr>
				<td id="frmTitle" name="frmTitle" width="225" nowrap valign="middle" align="center" style="overflow:auto"><iframe id=leftFrame name=leftFrame style="HEIGHT:100%;VISIBILITY:inherit;WIDTH:100%;Z-INDEX:2; cursor:hand; margin-left:3px;" frameborder="0" src="<%=basePath%>/admin/index_left.action" scrolling="no"></iframe></td>
				<td class="chink2" valign="center">
				<div id="switchPoint" onClick="switchSysBar()" title="显示/隐然左侧面板" style="position: inherit;height:100px;z-index:1;" value="1"><img id="tg" width="7" height="100" src="<%=basePath%>/images/call_left.gif"></div> 
				</td>  
				<td style="width:100%;padding:2px 3px 0px 2px;  background:#0176ab"><iframe id="rightFrame" name="rightFrame" style="HEIGHT:100%;VISIBILITY:inherit;WIDTH:100%;Z-INDEX:2;position:relative;" scrolling="no" frameborder="0" src=""></iframe></td>
			</tr>
			
			<tr id="frame_bottom">
				<td height="25" colspan=3><iframe name="bottomFrame" style="VISIBILITY:inherit;WIDTH:100%;height:100%;" scrolling="no" frameborder="0" src="<%=basePath%>/admin/index_bottom.action"></iframe></td>
			</tr>
		</table>
	</body>
</html>
